import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import LearnVue from '@/components/learnVue'
import Test from '@/components/Test'
import CompontentInsert from '@/components/compontentInsert'
import Index from '@/components/index'
import Hot from '@/components/hot'
import Tiyu from '@/hotPages/tiyu'
import Yule from '@/hotPages/yule'
import News from '@/hotPages/news'
import Swiper from '@/components/swiper'
import LazyLoad from '@/components/lazyLoad'
Vue.use(Router)

export default new Router({
  linkActiveClass:"linkActive",
  //mode:'history',
  routes: [
  {
      path: '/',
      name: 'lazyLoad',
      component: LazyLoad
    },
    {
      path: '/swiper',
      name: 'swiper',
      component: Swiper
    },
    {
      path: '/index',
      name: 'index',
      component: Index
    },
    {
      path: '/hot',
      name: 'hot',
      component: Hot,
      //重定向，路由嵌套默认加载的路由
      redirect:{name:'yule'},
      children:[
        {
          path:"yule",
          name:"yule",
          component:Yule
        },
        {
          path:"tiyu/:count",
          name:"tiyu",
          component:Tiyu
        }
      ]
    },
    {
      path: '/news/:id',
      name: 'news',
      component: News
    },
    {
      path: '/CompontentInsert',
      name: 'CompontentInsert',
      component: CompontentInsert
    },
     {
      path: '/LearnVue',
      name: 'LearnVue',
      component: LearnVue
    },
    {
      path: '/HelloWorld',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path:'/test',
      name:'Test',
      component:Test
    }
  ]
})
